package com.mic.security.dao;

import java.util.List;

import com.mic.core.model.critera.CriteraContext;
import com.mic.security.model.Role;

import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository;
/**
 * http://www.geekgumbo.com/2010/11/11/multiple-word-text-search-in-mysql/
 * http://www.mybatis.org/mybatis-3/zh/dynamic-sql.html
 * http://www.cnblogs.com/dongying/p/4092662.html
 * http://www.cnblogs.com/daviddai/p/3485593.html
 * http://limingnihao.iteye.com/blog/782190
 * 
 * @author mulan
 *
 */
@Repository("roleDAO")
public interface RoleDAO {
	

	public List<Role> listRolesByUserId(String userid);
	

	public Role findRoleById(String id);
	

	public Role findRoleByName(String name);

	public Integer countByCritera(@Param(value="keywords") String[] keywords);
	

	public List<Role> listByCritera(@Param(value="keywords") String[] keywords, @Param(value="start") Integer start, @Param(value="count")  Integer count);
	

	public List<Role> findAllRoles();


	public void saveRole(Role role);
	

	public void updateRole(Role role);

	public void deleteRoleById(String id);
	

}
